package mylab.demo.usm.biz.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import mylab.annotation.rds.ColumnComment;
import mylab.annotation.rds.Unique;
import mylab.base.constants.DbConst;
import mylab.base.model.entity.LongIdEntity;
import mylab.commons.api.model.Contacts;
import mylab.commons.web.mvc.entity.BaseEntity;

import java.time.LocalDateTime;

@Getter
@Setter
@ApiModel("租户表")
@TableName(value = DbConst.TENANT_TABLE_NAME, autoResultMap = true)
public class SysTenant extends BaseEntity {

    @ColumnComment("简称")
    @ApiModelProperty(value = "简称")
    @TableField
    private String shortname;

    @Unique
    @ColumnComment("域名")
    @ApiModelProperty(value = "域名")
    @TableField
    private String domain;

    @ColumnComment("icon图片")
    @ApiModelProperty(value = "icon图片")
    @TableField
    private String icon;

    @Unique
    @ColumnComment("授权码")
    @ApiModelProperty(value = "授权码")
    @TableField
    private String licenseKey;

    @ColumnComment("账号限额")
    @ApiModelProperty(value = "账号限额")
    @TableField
    private Long accountLimit;

    @ColumnComment("过期时间")
    @ApiModelProperty(value = "过期时间")
    @TableField
    private LocalDateTime expireTime;

    @ColumnComment("联系人")
    @ApiModelProperty(value = "联系人")
    @TableField(typeHandler = JacksonTypeHandler.class)
    private Contacts contacts;

}
